#ifndef CCIRCLE_H
#define CCIRCLE_H
#include "2D/Vector2D.h"
#include "VideoDriver.h"
#include "CBound.h"
#include "CWall2D.h"
enum ECollide {
		E_NONE = 0,
		E_LEFT,
		E_TOP,
		E_RIGHT,
		E_BOTTOM,
	};
class CCircle
{
public:
	Vector2D m_vPosition;
	float m_fRadius;
	float m_fMass;
	Vector2D m_vVelocity;
	Vector2D m_vG;

	CCircle(){}

	CCircle(Vector2D vpos, float radius, float mass, Vector2D vv)
	{
		m_vPosition = vpos;
		m_fRadius = radius;
		m_fMass = mass;
		m_vVelocity = vv;
		m_vG = Vector2D(0.0f, 0.98f);
	}
	void Render();
	void UpdateWidthBound(CBound bound);
	bool PointIntoCircle(Vector2D v)
	{
		if(m_vPosition.Distance(v) > m_fRadius)
			return false;
		return true;
	}
	bool TouchPressed(Vector2D v)
	{
		if(m_vPosition.Distance(v) > m_fRadius)
			return false;
		return true;
	}
	enum ECollide m_eCollideStatus;
	void TouchActionDrag(int x, int y);
	void TouchActionDown(int x, int y);
	void TouchActionUp(int x, int y);
	void CheckCollisionWithBound(CBound bound);
};
static bool s_bPressed = false;
static bool s_bDragged = false;
#endif